package com.tangmu.rabbits.ui.activity.mine;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.tangmu.rabbits.R;
import com.tangmu.rabbits.base.BaseActivity;
import com.tangmu.rabbits.constants.Constants;
import com.tangmu.rabbits.widget.ThumbnailView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 常见问题
 */
public class FAQActivity extends BaseActivity {


    @BindView(R.id.iv_header_left)
    ThumbnailView ivHeaderLeft;
    @BindView(R.id.tv_header_title)
    TextView tvHeaderTitle;
    @BindView(R.id.iv_header_right)
    ThumbnailView ivHeaderRight;
    @BindView(R.id.tv_title1)
    TextView tvTitle1;
    @BindView(R.id.iv_question1)
    ImageView ivQuestion1;
    @BindView(R.id.rl_question1)
    RelativeLayout rlQuestion1;
    @BindView(R.id.tv_question1)
    TextView tvQuestion1;
    @BindView(R.id.tv_title2)
    TextView tvTitle2;
    @BindView(R.id.iv_question2)
    ImageView ivQuestion2;
    @BindView(R.id.rl_question2)
    RelativeLayout rlQuestion2;
    @BindView(R.id.tv_question2)
    TextView tvQuestion2;

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.statusBarColor(R.color.transparent).titleBar(R.id.headerView).init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_faq;
    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initView() {
        setHeaderImage(Constants.Position.LEFT, R.drawable.icon_back, false, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        setHeaderTitle("常见问题");

    }

    @OnClick(R.id.rl_question1)
    public void question1() {
        if (tvQuestion1.getVisibility() == View.VISIBLE) {
            tvQuestion1.setVisibility(View.GONE);
            ivQuestion1.setImageResource(R.drawable.ic_down);
        } else {
            tvQuestion1.setVisibility(View.VISIBLE);
            ivQuestion1.setImageResource(R.drawable.ic_up);
        }
    }

    @OnClick(R.id.rl_question2)
    public void question2() {
        if (tvQuestion2.getVisibility() == View.VISIBLE) {
            tvQuestion2.setVisibility(View.GONE);
            ivQuestion2.setImageResource(R.drawable.ic_down);
        } else {
            tvQuestion2.setVisibility(View.VISIBLE);
            ivQuestion2.setImageResource(R.drawable.ic_up);
        }
    }

}
